import Vue from 'vue'
import VueRouter from 'vue-router'
import config from "@/config";
const redirectPath =  config.isLogin ? '/index' : '/login';
Vue.use(VueRouter)

const routes = [
  {  path: "*", redirect: redirectPath },
  {  path: '/login',  component: () => import(/* webpackChunkName: "index" */ '@/views/Login')},
  {  path: '/index',  component: () => import(/* webpackChunkName: "index" */ '@/views/Index')},
	{  path: '/list',  component: () => import(/* webpackChunkName: "list" */ '@/views/List')},
]

const router = new VueRouter({
  routes
})

export default router
